<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/DTD/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<title>dLite - lightweight JavaScript library with the vital functions - allows you to control development</title>
	<style type="text/css">
		@import url("../css/dlite.css");
	</style>
	<!--[if lt IE 7]>
		<link rel="stylesheet" href="../css/ie.css" type="text/css">
	<![endif]-->
	<link rel="Shortcut icon" href="http://www.robertnyman.com/dlite/images/favicon.png">
</head>

<body>
	
	<div id="container">
			<div id="header">
				<h1>
					<a id="logo" href="../index.html"><img src="../images/logo.png" alt="dLite"></a>
				</h1>
				<div id="navigation">
					<ul>
						<li><a href="../index.html" class="home">Home</a></li>
						<li class="last"><a href="index.html" class="documentation">Documentation</a></li>
					</ul>
				</div>
			</div>
			
			<div id="main-content" class="documentation-content">
				
				<div id="download">
					<h3>Download dLite</h3>
					<p>
						<a href="http://code.google.com/p/dlite/downloads/detail?name=dLite-1.0.js" class="download">dLite <span class="file-size">(7.9kb)</span></a>
					</p>
					<p>
						<a href="http://code.google.com/p/dlite/downloads/detail?name=dLiteCompressed-1.0.js" class="download">dLite, compressed <span class="file-size">(4.2kb)</span></a>
					</p>
				</div>
				
				<h2>dLite documentation</h2>
				<p>There are 9 power functions in dLite, and their functionality and parameters are presented here. The idea is that each function has a semantic and self-explanatory name, so any developer looking at the code will understand what it will do.</p>
				<p>The names are deliberately close to the native DOM methods, to make it easier to adapt to, but at the same time guaranteed to avoid name collision. Which parameters and what format they are expected to be in are described below.</p>
				<h3>elm(<span class="parameter-name">id</span>)</h3>
				<p>Finds an element with the sent-in <code>id</code>.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>var container = elm("container");</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>id</code> (required)</li>
				</ul>
				
				
				<h3>elmsByClass(<span class="parameter-name">className</span>, <span class="parameter-name">tag</span>, <span class="parameter-name">elm</span>)</h3>
				<p>Finds an element with the sent-in <code>className</code>, <code>tag</code> and <code>elm</code>. Parameter <code>tag</code> is the desired tag name as a string, parameter <code>elm</code> is a DOM element set as the context to look in.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>var externalLinks = elmsByClass("external", a);</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>className</code> (required)</li>
					<li><code>tag</code> (optional)</li>
					<li><code>elm</code> (optional)</li>
				</ul>
				
			
				<h3>DOMReady(<span class="parameter-name">function/functionReference</span>)</h3>
				<p>Takes one or several <code>function</code>/<code>functionReference</code> parameters, which will be called as soon as the DOM has loaded.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>DOMReady(runAtDOMLoad);</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>function/functionReference</code> (required)</li>
				</ul>
				
				
				<h3>addClass(<span class="parameter-name">elm</span>, <span class="parameter-name">className</span>)</h3>
				<p>Adds a CSS class to an element. Parameter <code>elm</code> is a DOM element reference, parameter <code>className</code> is a string.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>addClass(elm("container"), "active");</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>elm</code> (required)</li>
					<li><code>className</code> (required)</li>
				</ul>
				
				
				<h3>removeClass(<span class="parameter-name">elm</span>, <span class="parameter-name">className</span>)</h3>
				<p>Removes a CSS class from an element. Parameter <code>elm</code> is a DOM element reference, parameter <code>className</code> is a string</p>
				
				<h4>Example</h4>
				<pre class="code"><code>removeClass(elm("container"), "active");</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>elm</code> (required)</li>
					<li><code>className</code> (required)</li>
				</ul>
				
				
				<h3>addEvent(<span class="parameter-name">elm</span>, <span class="parameter-name">evt</span>, <span class="parameter-name">func</span>)</h3>
				<p>Adds an event to an element. Parameter <code>elm</code> is a DOM element reference, parameter <code>evt</code> is a string, parameter <code>func</code> is a function or a function reference.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>addEvent(elm("container"), "click", handleClick);</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>elm</code> (required)</li>
					<li><code>evt</code> (required)</li>
					<li><code>func</code> (required)</li>
				</ul>
				
				
				
				<h3>removeEvent(<span class="parameter-name">elm</span>, <span class="parameter-name">evt</span>, <span class="parameter-name">func</span>)</h3>
				<p>Removes an event from an element. Parameter <code>elm</code> is a DOM element reference, parameter <code>evt</code> is a string, parameter <code>func</code> is a function or a function reference.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>removeEvent(elm("container"), "click", handleClick);</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>elm</code> (required)</li>
					<li><code>evt</code> (required)</li>
					<li><code>func</code> (required)</li>
				</ul>
				
				
				<h3>stopDefault(<span class="parameter-name">evt</span>)</h3>
				<p>Stops the default behavior of an event. Parameter <code>evt</code> is an event object.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>stopDefault(evt);</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>evt</code> (required)</li>
				</ul>
				
				
				<h3>cancelBubbling(<span class="parameter-name">evt</span>)</h3>
				<p>Cancels the bubbling of an event.. Parameter <code>evt</code> is an event object.</p>
				
				<h4>Example</h4>
				<pre class="code"><code>cancelBubbling(evt);</code></pre>
				
				<h4>Parameters</h4>
				<ul>
					<li><code>evt</code> (required)</li>
				</ul>
		
			<div id="footer">
				<i>Created by Robert Nyman, <a href="http://www.robertnyman.com">http://www.robertnyman.com</a>. <br>Released under a <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>.</i>
			</div>	
										
			</div>
					
	</div>
	
	<div class="stat-hide">
		<!-- Google Analytics code -->
		<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
		<script type="text/javascript">
			_uacct = "UA-56164-1";
			urchinTracker();
		</script>

		<!-- Start of StatCounter Code -->
		<script type="text/javascript">
		<!-- 
		var sc_project=593937; 
		var sc_partition=4; 
		var sc_security="175a1fec"; 
		//-->
		</script>

		<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a class="statcounter" href="http://www.statcounter.com/"><img class="statcounter" src="http://c5.statcounter.com/counter.php?sc_project=593937&amp;java=0&amp;security=175a1fec" alt="free geoip" /></a></div></noscript>
		<!-- End of StatCounter Code -->
	</div>
	
	
</body>
</html>